//
//  CustomCollectionCell.m
//  Mecca
//
//  Created by Ryan Enguero on 6/24/14.
//  Copyright (c) 2014 TapDash Heuristics. All rights reserved.
//

#import "CustomCollectionCell.h"

@implementation CustomCollectionCell

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

-(void)setImageString:(NSString *)strImage{
    [NSThread detachNewThreadSelector:@selector(showImage:) toTarget:self withObject:strImage];
}

-(void)showImage:(NSString*)imageShow{
    @autoreleasepool {
        NSData *imageList = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageShow]];
        [self.imagePhoto setAlpha:0];
        [UIView animateWithDuration:0.5 animations:^{
            
            self.imagePhoto.image = [UIImage imageWithData:imageList];
            [self.imagePhoto setAlpha:1];
            
            [self.activity setHidden:YES];
            
        } completion:^(BOOL finished) {
            
        }];
        
        
        //[self animationActivity];
    }
}

@end
